import requests

url = 'https://www.baidu.com/'

response = requests.get(url=url)

# 设置编码格式
response.encoding = 'utf-8'

# 获取网页源码
# print(response.text)

# 获取二进制数据
# print(response.content)

# 获取响应状态码
# print(response.status_code)

# 获取相应头数据
# print(response.headers)

# 获取请求url
print(response.url)